package com.ruoyi.passenger.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.passenger.mapper.VehicleRechargeMapper;
import com.ruoyi.passenger.domain.VehicleRecharge;
import com.ruoyi.passenger.service.IVehicleRechargeService;

/**
 * 充值记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-06-26
 */
@Service
public class VehicleRechargeServiceImpl implements IVehicleRechargeService 
{
    @Autowired
    private VehicleRechargeMapper vehicleRechargeMapper;

    /**
     * 查询充值记录
     * 
     * @param id 充值记录主键
     * @return 充值记录
     */
    @Override
    public VehicleRecharge selectVehicleRechargeById(Long id)
    {
        return vehicleRechargeMapper.selectVehicleRechargeById(id);
    }

    /**
     * 查询充值记录列表
     * 
     * @param vehicleRecharge 充值记录
     * @return 充值记录
     */
    @Override
    public List<VehicleRecharge> selectVehicleRechargeList(VehicleRecharge vehicleRecharge)
    {
        return vehicleRechargeMapper.selectVehicleRechargeList(vehicleRecharge);
    }

    /**
     * 新增充值记录
     * 
     * @param vehicleRecharge 充值记录
     * @return 结果
     */
    @Override
    public int insertVehicleRecharge(VehicleRecharge vehicleRecharge)
    {
        vehicleRecharge.setCreateTime(DateUtils.getNowDate());
        return vehicleRechargeMapper.insertVehicleRecharge(vehicleRecharge);
    }

    /**
     * 修改充值记录
     * 
     * @param vehicleRecharge 充值记录
     * @return 结果
     */
    @Override
    public int updateVehicleRecharge(VehicleRecharge vehicleRecharge)
    {
        return vehicleRechargeMapper.updateVehicleRecharge(vehicleRecharge);
    }

    /**
     * 批量删除充值记录
     * 
     * @param ids 需要删除的充值记录主键
     * @return 结果
     */
    @Override
    public int deleteVehicleRechargeByIds(Long[] ids)
    {
        return vehicleRechargeMapper.deleteVehicleRechargeByIds(ids);
    }

    /**
     * 删除充值记录信息
     * 
     * @param id 充值记录主键
     * @return 结果
     */
    @Override
    public int deleteVehicleRechargeById(Long id)
    {
        return vehicleRechargeMapper.deleteVehicleRechargeById(id);
    }
}
